import Vue from "vue"
import VueRouter from 'vue-router'


// 引入组件
import MyIndex from '../components/MyIndex'
import MyLogin from '../components/MyLogin'
import MyRegister from '../components/MyRegister'

import MySearch from '../search/MySearch'
import MySearchUser from '../search/MySearchUser'
import MySearchFeed from '../search/MySearchFeed'

import MyUser from '../user/MyUser'
import MyUserSet from '../user/MyUserSet'
import MyUserFeed from '../user/MyUserFeed'
import MyUserFans from '../user/MyUserFans'
import MyUserFollows from '../user/MyUserFollows'

// 应用
Vue.use(VueRouter)

export default new VueRouter({
  routes: [
    {
      path: '/',
      component: MyIndex,
    },
    {
      path: '/index',
      component: MyIndex
    },
    {
      path: '/login',
      component: MyLogin
    },
    {
      path: '/register',
      component: MyRegister
    },
    {
      path: '/search',
      component: MySearch,
      redirect: '/search/feed',
      children: [
        {
          path: 'feed',
          component: MySearchFeed
        },
        {
          path: 'user',
          component: MySearchUser
        }
      ]
    },
    {
      path: '/set',
      component: MyUserSet
    },
    {
      path: '/u',
      component: MyUser,
      redirect: '/u/feed',
      children: [
        {
          path: 'feed',
          component: MyUserFeed
        },
        {
          path: 'fans',
          component: MyUserFans
        },
        {
          path: 'follows',
          component: MyUserFollows
        }
      ]
    },
    
  ]
})